package itman.mapper;

import itman.po.DeliveryAddress;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface DeliveryAddressMapper {
    @Select("select * from deliveryaddress where userId=#{userId} order by daId")
    public List<DeliveryAddress> listDeliveryAddressByUserId(String userId);
    @Select("select * from deliveryaddress where daId=#{daId}")
    public DeliveryAddress getDeliveryAddressById(Integer daId);
    @Insert("insert into deliveryaddress values(null,#{contactName},#{contactSex},#{contactTel},#{adress},#{userId})")
    public int saveDeliveryAddress(DeliveryAddress deliveryaddress);
    @Update("update deliveryaddress set contactName=#{contactName},contactSex=#{contactSex},contactTel=#{contactTel},adress=#{adress} where daId=#{daId}")
    public int updateDeliveryAddress (DeliveryAddress deliveryaddress);
    @Delete("delete from deliveryaddress where daId=#{daId}")
    public int removeDeliveryAddress (Integer daId);

}
